spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#9
Merged
Conversation
Lockstep major-version cut alongside the protowire v1.0 spec freeze and protowire-cpp v1.0.0 (which this port wraps via nanobind). Hard cutover, no alias period. Python API rename surface: pxf.TableDirective → pxf.DatasetDirective pxf.TableReader → pxf.DatasetReader pxf.Result.tables → pxf.Result.datasets + pxf.ProtoDirective + pxf.ProtoShape (new) + Result.protos: tuple[ProtoDirective, ...] (new) FFI shape change: _protowire.pxf_unmarshal_full now returns a 6-tuple (raw, set_paths, null_paths, directives, datasets, protos). The cpp side surfaces ProtoDirective as a (shape, type_name, body) tuple; Python wraps it into the new frozen dataclass. Source files renamed: src/_protowire/module.cc (PyTableReader → PyDatasetReader) src/protowire/pxf.py (class + helper renames) tests/test_pxf_table_reader.py → tests/test_pxf_dataset_reader.py New: tests/test_pxf_proto_directive.py with 16 cases covering all four @proto body shapes through the FFI, multi-@proto, nested braces, three error paths, parametrized reserved-name rejection, and a ProtoDirective dataclass check. Version bumps: pyproject.toml 0.75.0 → 1.0.0 src/protowire/__init__ 0.75.0 → 1.0.0 pytest: 100 tests, 0 failures.
The CI / publish / codeql workflows pinned the sibling cpp checkout to v0.75.0 — the Python source compiles against the v1.0 API surface (Datasets / Protos / DatasetReader) and fails against the older TableReader / Tables surface. Local builds passed because the local protowire-cpp checkout is at main (v1.0.0); CI's pinned checkout was the v0.75.0 tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lockstep major-version cut alongside the protowire v1.0 spec freeze and protowire-cpp v1.0.0, which this port wraps via the nanobind FFI. Hard cutover, no alias period.
Python API rename surface
pxf.TableDirectivepxf.DatasetDirectivepxf.TableReaderpxf.DatasetReaderpxf.Result.tablespxf.Result.datasetspxf.ProtoDirective+pxf.ProtoShape(new)pxf.Result.protos: tuple[ProtoDirective, ...](new)FFI shape change
_protowire.pxf_unmarshal_fullnow returns a 6-tuple(raw, set_paths, null_paths, directives, datasets, protos). The cpp side surfacesProtoDirectiveas a(shape, type_name, body)tuple; Python wraps it into the new frozen dataclass with theshapefield typed asLiteral["anonymous", "named", "source", "descriptor"].Source files renamed
tests/test_pxf_table_reader.py→tests/test_pxf_dataset_reader.pyPyTableReader/PyTableDirective/ etc. renamed insrc/_protowire/module.cc.Test plan
pip install -e .against the v1.0.0 sibling cpp checkoutpytest: 100 tests, 0 failurestests/test_pxf_proto_directive.pywith 16 cases — all four@protobody shapes via FFI roundtrip, multi-@proto, nested-brace bodies, three error paths, parametrized reserved-directive-name rejection,ProtoDirectivedataclass checkVersion bumps
pyproject.toml0.75.0→1.0.0src/protowire/__init__.py__version__0.75.0→1.0.0Lockstep v1.0 ports
See the protowire v1.0.0 release for the full lockstep table. With this PR merged + tagged,
protowire-pythonships asprotowire==1.0.0on PyPI.